package org.langcom.state;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
import java.util.Map;

import org.langcom.logic.LogicException;

public interface IAutomataState<T> {

	public void setInput(T input);
	
	public T getInput();
	
	public IState getCurrentState();
	/**
	 * This is key method of automata. The recurring call of this method realize fundamental cycle of calculation of state automata
	 */
	public void checkState();
	/**
	 * This method returns the all possible states of the input object
	 */
	public List<IState> getAllStates();
	
	public void addState(IState state);
	
	public void addStateTransition(IStateTransition transition);

	public Map<IState,List<IStateTransition>> getTransitionFromMap();
	
	public Map<IState,List<IStateTransition>> getTransitionToMap();
	
	public void addChangeListener(PropertyChangeListener changeListener);
	
	public void removeChangeListener(PropertyChangeListener changeListener); 
	
	public void firePropertyChanged(PropertyChangeEvent event);
	
	public void prepareEvent(Enum eventType, Object... params) throws LogicException;
	
	public void processEvent(Enum eventType, Object... params) throws Exception;
	
}
